﻿@model LotteryVoteMVC.Models.RegisterModel
@using LotteryVoteMVC.Resources
@using LotteryVoteMVC.Utility
@{
    Layout = null;
}
<!DOCTYPE html>
<html>
<head>
    <title>Add</title>
    <script src="@Url.Content("~/Scripts/jquery-1.5.1.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/jquery-ui-1.8.11.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/Customer/comm.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/Customer/DynamicRange.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/Customer/ajaxHelper.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/Customer/addUser.js")" type="text/javascript"></script>
    <link href="@Url.Content("~/Content/themes/base/jquery.ui.theme.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/Content/comm.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/Content/TableBase.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/Content/inputs.css")" rel="stylesheet" type="text/css" />
</head>
<body class="long">
    @using (Html.BeginForm())
    {
        <table cellpadding="0" cellspacing="0">
            <thead>
                <tr>
                    <td colspan="2">
                        @(Resource.New + Resource.ResourceManager.GetString((ViewBag.User.Role + 1).ToString()))
                    </td>
                </tr>
            </thead>
            <colgroup>
                <col style="width: 25%;" />
                <col style="width: 75%" />
            </colgroup>
            <tbody>
                <tr>
                    <td style="background: #00FF7F">
                        @Resource.YourPassword
                    </td>
                    <td style="background: #00FF7F">
                        @Html.PasswordFor(it => it.YourPassword)
                        @Html.ValidationMessageFor(it => it.YourPassword)
                    </td>
                </tr>
                <tr>
                    <td>
                        @Resource.UserName
                    </td>
                    <td>
                        <strong>
                            @ViewBag.NextName</strong>
                        @Html.Hidden("UserName", (string)ViewBag.NextName)
                        @Html.ValidationMessageFor(it => it.UserName)
                    </td>
                </tr>
                <tr>
                    <td>
                        @Resource.Name
                    </td>
                    <td>
                        @Html.TextBoxFor(it => it.Name)
                        @Html.ValidationMessageFor(it => it.Name)
                    </td>
                </tr>
                <tr>
                    <td>
                        @Resource.Password
                    </td>
                    <td>
                        @Html.PasswordFor(it => it.Password)
                        @Html.ValidationMessageFor(it => it.Password)
                    </td>
                </tr>
                <tr>
                    <td>
                        @Resource.Confirm
                    </td>
                    <td>
                        @Html.PasswordFor(it => it.ConfirmPassword)
                        @Html.ValidationMessageFor(it => it.ConfirmPassword)
                    </td>
                </tr>
                <tr>
                    <td>
                        @Resource.Status
                    </td>
                    <td>
                        @Html.DropDownListFor(it => it.State, ViewBag.UserState as IEnumerable<SelectListItem>)
                    </td>
                </tr>
                <tr>
                    <td>
                        @Resource.Currency
                    </td>
                    <td>
                        VND
                    </td>
                </tr>
                <tr>
                    <td>
                        @Resource.GivenCredit
                    </td>
                    <td>
                        @Html.TextBoxFor(it => it.GivenCredit)
                        .000
                        @Html.ValidationMessageFor(it => it.GivenCredit)
                        @Html.HiddenFor(it => it.MinGivenCredit)
                        &nbsp;
                        @Resource.AvailableGivenCredit
                        @ViewBag.User.UserInfo.AvailableGivenCredit
                        @Html.HiddenFor(it => it.MaxGivenCredit)
                    </td>
                </tr>
                <tr>
                    <td>
                        @Resource.Email
                    </td>
                    <td>
                        @Html.TextBoxFor(it => it.Email)
                        @Html.ValidationMessageFor(it => it.Email)
                    </td>
                </tr>
                <tr>
                    <td>
                        @Resource.Market
                    </td>
                    <td>
                        @Html.CheckBoxListFor(it => it.Species, ViewBag.Species as MultiSelectList, new { @readonly = "readonly" }, new { disabled = "disabled" })
                    </td>
                </tr>
                @if (ViewBag.User.Role < LotteryVoteMVC.Models.Role.Agent)
                {
                    <tr>
                        <td>
                            @Resource.ShareRateLimit
                        </td>
                        <td>
                            @Resource.Min
                            0%
                            @Html.HiddenFor(it => it.MinShareRate)
                            @Resource.Max
                            @CultureHelper.ToPercent(ViewBag.User.UserInfo.ShareRate)
                            @Html.HiddenFor(it => it.MaxShareRate)
                        </td>
                    </tr>
                    <tr>
                        <td>
                            @Resource.ShareRate
                        </td>
                        <td>
                            @Html.TextBoxFor(it => it.ShareRate)
                            @Html.ValidationMessageFor(it => it.ShareRate)
                        </td>
                    </tr>
                }@if (ViewBag.User.Role == LotteryVoteMVC.Models.Role.Agent)
                 {
                    <tr>
                        <td>
                            @Resource.Package
                        </td>
                        <td>
                            @Html.DropDownListFor(it => it.CommGroup, ViewBag.CommGroup as IEnumerable<SelectListItem>)
                        </td>
                    </tr>
                 }
                <tr>
                    <td colspan="2">
                        <input type="submit" name="submit" id="submit" value="@Resource.Submit" />
                        <input type="reset" name="reset" id="reset" value="@Resource.Reset" />
                    </td>
                </tr>
            </tbody>
        </table>
    }
</body>
</html>
